package com.ll.demo1;

/**
 * @description:
 * @author: LiuLei
 * @create: 2024-07-18
 **/
public class WhiteMain {
    public static void main(String[] args) {
        System.out.println(new Dog().say());
        int count = 0;
        while (true) {
            // 等待0.5秒
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }
            count++;
            String say = new Dog().say();
            // 输出内容和次数
            System.out.println(say +"___" +  count);
            // 内容不对或者次数达到1000次以上输出
            if (!"dog".equals(say) || count >= 1000) {
                System.out.println("有人偷了我的狗！");
                //break;
            }
        }

    }
}
